<?php
namespace app\home\controller;
use think\captcha\Captcha;
use think\config;
use think\console\command\make\Controller;
class Verify extends Controller{
    public function __construct(){
        parent::__construct();
    }
    public function index($id=''){
		$config= [
	        'codeSet'  => '1234567890',
            'length'   => 4,
            'fontSize' => 16,
            'secure'=>false,
            'useNoise' => false,
            'useCurve' => false,
	    ];
        ob_end_clean();
        $captcha = new Captcha($config);
        return $captcha->entry($id);
    }
    public function check($verify,$id=''){
        if(!captcha_check($verify)){
            return 0;
        }
        else{
            return 1;
        }
    }

}
